//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.itheima.pinda.authority.dto.auth;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;

@ApiModel(
        value = "RoleDTO",
        description = "角色"
)
public class RoleDTO {
    @ApiModelProperty("ID")
    private Long id;
    @ApiModelProperty("角色名称")
    @NotEmpty(
            message = "角色名称不能为空"
    )
    @Length(
            max = 30,
            message = "角色名称长度不能超过30"
    )
    @TableField(
            value = "name",
            condition = "%s LIKE CONCAT('%%',#{%s},'%%')"
    )
    private String name;

    public static RoleDTOBuilder builder() {
        return new RoleDTOBuilder();
    }

    public Long getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }

    public RoleDTO setId(final Long id) {
        this.id = id;
        return this;
    }

    public RoleDTO setName(final String name) {
        this.name = name;
        return this;
    }

    public RoleDTO() {
    }

    public RoleDTO(final Long id, final String name) {
        this.id = id;
        this.name = name;
    }

    public String toString() {
        return "RoleDTO(super=" + super.toString() + ", id=" + this.getId() + ", name=" + this.getName() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof RoleDTO)) {
            return false;
        } else {
            RoleDTO other = (RoleDTO)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$id = this.getId();
                Object other$id = other.getId();
                if (this$id == null) {
                    if (other$id != null) {
                        return false;
                    }
                } else if (!this$id.equals(other$id)) {
                    return false;
                }

                Object this$name = this.getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof RoleDTO;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        return result;
    }

    public static class RoleDTOBuilder {
        private Long id;
        private String name;

        RoleDTOBuilder() {
        }

        public RoleDTOBuilder id(final Long id) {
            this.id = id;
            return this;
        }

        public RoleDTOBuilder name(final String name) {
            this.name = name;
            return this;
        }

        public RoleDTO build() {
            return new RoleDTO(this.id, this.name);
        }

        public String toString() {
            return "RoleDTO.RoleDTOBuilder(id=" + this.id + ", name=" + this.name + ")";
        }
    }
}
